package com.talking.adapter

import android.app.Activity
import com.talking.bean.MeBean
import android.widget.ArrayAdapter
import android.view.ViewGroup
import android.annotation.SuppressLint
import android.view.View
import com.talking.databinding.ItemMeBinding

class MeAdapter(private val activity: Activity, objects: List<MeBean?>) : ArrayAdapter<MeBean?>(activity, 0, objects){
    override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
        @SuppressLint("ViewHolder") val binding = ItemMeBinding.inflate(activity.layoutInflater)
        val bean = getItem(position)
        binding.itemMeTitle.text = bean!!.title
        binding.itemMeImg.setImageResource(bean.res!!)
        return binding.root
    }
}